/**
 * admui-basic v2.1.0 (http://www.admui.com/)
 * Copyright 2015-2019 Admui Team
 * Licensed under the Admui License 1.1 (http://www.admui.com/about/license)
 */
(function(window, document, $) {
  'use strict';

  window.App.extend({
    run: function() {
      var lastIdx = null;
      var table = $('#dataTableExample').DataTable($.concatCpt('dataTable'));
      $('#admui-pageContent')
        .on('mouseover', '#dataTableExample tbody td', function() {
          var colIdx = table.cell(this).index().column;
          if (colIdx !== lastIdx) {
            $(table.cells().nodes()).removeClass('highlight');
            $(table.column(colIdx).nodes()).addClass('highlight');
          }
        })
        .on('mouseleave', '#dataTableExample tbody', function() {
          $(table.cells().nodes()).removeClass('highlight');
        });
    }
  });

  window.App.run();
})(window, document, jQuery);
